home *** CD-ROM | disk | FTP | other *** search
/ Info-Mac 4 / Info_Mac IV CD-ROM (Pacific HiTech Inc.)(August 1994).iso / Text Processing / PlainText129a Folder / PlainText Worksheet < prev   
Text File  |  1994-05-12  |  18KB  |  370 lines

  1. ;----------------------------------------------------------------------------
  2. ;                                 Worksheet
  3. ;
  4. ; Use this window as a scratch pad for keeping notes and as a space for 
  5. ; temporary and intermediate work. Its contents are saved between launches
  6. ; of the PlainText program. If you don’t like the idea of having a work-
  7. ; that is always open, select the “No Worksheet” option in the Edit Menu.
  8. ;
  9. ;                                            Mel Park, Memphis, Tennessee
  10. ;----------------------------------------------------------------------------
  11.  
  12.     This is still an early version of PlainText. The first non-beta version
  13. was version 1.2.1. This is version 1.2.9a. All major features work, and seem
  14. to work well, on the machines that I and others have tested it on.
  15.  
  16.     You should make a copy of this file and save it somewhere with a different
  17. name. One way of doing this is to select the “Save a Copy” item from the
  18. File Menu. Name the copy “Original PlainText Worksheet” or some such.
  19.  
  20. File Menu
  21.     This is standard Mac stuff. PlainText will open any text file. Printing is
  22. pretty ordinary. There is no way to change print margins or lines per page.
  23. A short vertical line appears at the top of every text window which
  24. indicates the recommended right margin. Text wrapped to this width will be
  25. centered on the printed page. PlainText prints the page number at the
  26. bottom of every page.
  27.     
  28.     If you hold the option key down while selecting the Open menu item, then
  29. all files, not just text files, are displayed and can be opened. Files
  30. opened in this way are read only. You can copy data from them to the
  31. clipboard but not change them in any way.
  32.  
  33.     The “Save” menu item is only activated when a file has been changed by
  34. adding or removing characters. The term “dirty” is commonly used to
  35. describe text files in this state. Non-editing changes, such as changing
  36. the font or adding a mark do not dirty a file. However, all such changes,
  37. even scroll position and selection range, are always saved to disk when you
  38. close a file. So, don’t be surprised by disk activity when you close a file
  39. in which you have made no changes.
  40.  
  41. Edit Menu
  42.     Shift Right and Shift Left add or remove one tab on each line or, when
  43. word wrap is on, each paragraph within the selection region. At the same
  44. time, it converts all space runs to the corresponding number of tabs.
  45. “Align” aligns all subsequent lines to the first line in the selection
  46. region.
  47.  
  48.     The Undo function provides the one level of undo that you expect with a
  49. Macintosh application. “No Worksheet” will close the worksheet window and
  50. set PlainText to not open a worksheet window in the future. It is reversed
  51. by the “Use Worksheet” menu item which becomes an option when there is no
  52. worksheet. The Format dialog of the Edit Menu is where you select fonts and
  53. font size, turn wordwrapping on or off (on is the default), select tab
  54. width, and show or not show invisible characters. These settings are
  55. remembered for each document and retained between launches. (Naturally,
  56. this is a Mac.)
  57.  
  58.     The “Format…” menu item calls a dialog for changing text font, text size,
  59. and certain preferences. The “Show Invisibles” check box prints ‘¿’ for all
  60. non-printing characters, ‘Δ’ for tabs, ‘¬’ for carriage returns, and ‘◊’
  61. for spaces. Automatic word wrap can be turned off or on and made to occur
  62. when text exceeds the width of the text’s window or a particular number of
  63. characters (Line Length). This line length parameter is also used for the
  64. “Hard Wrap to Length” item in the Convert Menu. The “Auto Indent” feature
  65. will look at the preceeding line, when word wrap is off, or paragraph, when
  66. word wrap is on, and indent each new line to align with it. Clicking the
  67. okay button (or typing the return or enter key) applies those settings to
  68. the front window. Clicking the cancel button (or typing escape or
  69. command-period) cancels the dialog and does not make any changes to the
  70. front window. Clicking on the “All Files” button applies the settings to
  71. the front window and saves them as default settings that will be applied to
  72. all new windows and any foreign file that has not been previously opened by
  73. PlainText, MPW, or Alpha.
  74.  
  75. Find Menu
  76.     This all works. “Find…” and “Replace…” are pretty standard and pretty
  77. intuitive functions for text windows. The search string can be a selection
  78. expression, that is, an expression that contains wildcards. Try a search
  79. using *menu as the selection expression. Choose “Find…” and type “*menu”
  80. (with or without quotes) and click the “Selection Expression” radio button.
  81. Now click the Find button (or hit the return key). See how a line
  82. containing “menu” has been found? Command-G repeats the search.
  83.  
  84.     If the selection expression is a number, it is interpreted as a line
  85. number. Try 83 as a selection expression.
  86.  
  87.     This line, the 83rd in this window, will be selected.
  88.  
  89.     If you hold down the shift key when you choose any of the Find menu items,
  90. then the search will be in the reverse direction. This is handiest when
  91. used in conjunction with the keyboard equivalents command-h and command-g.
  92.  
  93. Mark Menu
  94.     Marks are like bookmarks that you can place in a text file so that you can
  95. recall previous selections. When you select a mark from the Mark Menu, the
  96. text corresponding to that mark is selected and the window scrolls to show
  97. it. You can add new marks with the Mark menu item and remove them with
  98. Unmark. You can alphabetize the order in which marks are displayed in the
  99. Mark Menu by selecting the Alphabetize menu item. Selecting it again
  100. restores the original order. Look at the Marks that I have made for this
  101. file by opening the Marks Menu.
  102.  
  103. Window Menu
  104.     Stack and Tile windows work, as does the rest, a catalog of open windows.
  105. The menu item for the front window is checked. The target window is
  106. indicated by the bullet symbol (•). Windows whose changes have not yet been
  107. saved to disk are underlined.
  108.  
  109. Convert Menu
  110.     These functions all work. If you spot bugs in them, be sure to let me
  111. know. This set of functions, by the way, was selected from those I find
  112. myself using many times a day in Vantage, the desk accessory editor I have
  113. used for years. The big, full-featured editors, like Pete Keleher’s Alpha
  114. and BBEdit, by Rich Siegel, have these features, plus many more, as well.
  115. Strip Linefeeds is the way to convert an MS/DOS text file to the Mac
  116. convention. Strip Controls removes all characters with an Ascii code of 31
  117. or less, except carriage returns and tabs. Form Paragraphs and Straight to
  118. Curly Quotes gets it ready for pasting into a word processor. Hard Wrap to
  119. Window and Curly to Straight quotes reverses those steps, as when you want
  120. to prepare text for e-mail. Both Hard Wrap functions insert hard carriage
  121. returns at line ends, where a line end is either defined by the size of the
  122. window (Hard Wrap to Window) of the line length parameter set in the Format
  123. Dialog (Hard Wrap to Length).
  124.  
  125.     Besides being fast and able to handle even very large files, PlainText has
  126. these built-in features:
  127.  
  128.     1.    Double-clicking selects a whole word. Note that double-clicking
  129.         the space after a word selects the preceeding word and the space.
  130.         This is a bug that is close enough to being a feature that I am 
  131.         not fixing it.
  132.     2.    Triple-clicking selects a whole line.
  133.     3.    Double clicking on or just before a bracket or parenthesis (i.e. 
  134.         “[”, “{”, etc.) causes all the text between the bracket or 
  135.         parenthesis and its matching bracket or parenthesis to become 
  136.         selected.
  137.     4.    Cutting, pasting, and undoing are fully implemented.
  138.     5.    The arrow keys work to move the insertion point or selection (hold
  139.         the shift key down) in the expected ways.
  140.     6.    Command-option-uparrow moves the insertion point to the top of the
  141.         file. Command-option-downarrow does the opposite. Holding the shift
  142.         key down while doing either of these extends the selection to either
  143.         the top or bottom of the document.
  144.     7.    Command-right arrow moves the insertion point to the end of the 
  145.         current line. Option-right arrow moves the cursor by words. The left
  146.         arrow combinations work in the same way, of course, and holding the
  147.         shift key down with any of these combinations extends the selection.
  148.         This is the standard Macintosh use of the arrow keys.
  149.     8.    It is a command-line interpreter in its own right. Simply type a 
  150.         command that PlainText understands and then hit the enter (not
  151.         return) key. This will work in any text window.
  152.  
  153.         The following commands can be executed from any text window: 
  154.         ls (same as dir in DOS), cd (change directory), open, target,
  155.         find, line. Open opens the named file and makes it the front window.
  156.         File is similar except the window is made the target window (second
  157.         from front). “line n” selects selects the nth line of the target
  158.         window (n is a number. “Find exp” searchs the target window for the
  159.         string “exp.” Wildcards can be used with the find and ls commands,
  160.         just as you would expect in DOS.
  161.  
  162.         In summary, hitting the enter key causes the current line or current 
  163.         selection, whichever is smaller, to be interpreted as a command line.
  164.  
  165.         Commands implemented:
  166.  
  167.             cd            Change default directory (folder). Note, the Mac 
  168.                         file system uses the colon to designate the present 
  169.                         or higher folders. Thus “cd ::” changes the default
  170.                         directory one level up.
  171.             chcre        Change a file’s creator. For example, 
  172.                         chcre 'MRPH' 'Current File' makes PlainText the
  173.                         creator of the file named ‘Current File.’
  174.             chtyp        Change the file type of a file, using the same
  175.                         syntax (chtyp type filename) as chcre.
  176.             file        Open a file and make it the target
  177.             find ss        Find a string in the target window
  178.             ls            List a directory’s contents
  179.             ls -l        Give a full listing of a directory’s contents
  180.             line nn        Select line nn in the target window
  181.             open ff        Open a file
  182.             stats        Prints the statistics of the target window
  183.  
  184. Target Window
  185.     Note that the “line” and “find” comands operate on the TARGET window. The
  186. target window is the window behind the front-most window.
  187.  
  188. Large Files
  189.     PlainText must load its text files entirely into memory. If you get an
  190. out-of-memory error message when trying to open a very large file, just
  191. increase the partition (in the Finder’s Get-Info box for PlainText) to be
  192. larger than the file being opened. In System 7, turn on virtual memory if
  193. necessary.
  194.  
  195. Bug Reports
  196.  
  197.     Send comments and complaints to:
  198.  
  199.         Mel Park
  200.         Associate Professor
  201.         Department of Anatomy and Neurobiology
  202.         University of Tennessee
  203.         855 Monroe Avenue
  204.         Memphis, TN 38163
  205.         (901) 448-5984
  206.         mpark@utmem1.utmem.edu
  207.  
  208. PlainText is free.
  209.  
  210. Revision History
  211.  
  212. 0.4:     Fixed Standard File System 6 incompatibilities.
  213. 0.5:     Wordwrap is now the default.
  214.          Horizontal scroll bar occurs when it should.
  215.          Wordwrap to window correctly updates window.
  216.          Fixed Out of Memory problem with add linefeeds.
  217. 0.6:     Worksheet is an option.
  218.          Added font scaling and changing.
  219.          Open, file, and line commands now work in System 6.
  220.          All text moved to resources so that PlainText can now be
  221.            internationalized.
  222. 0.7:     Added Align, Shift Left, and Shift Right functions.
  223.          Fixed bug in which a strings just past the cursor were not
  224.            found in a forward search.
  225.          Open with option key down shows all files, not just text
  226.            files.
  227. 0.8:     SaveAFile stores resources properly and no longer causes
  228.            crashes.
  229.          The Standard File dialog is no longer displayed twice for new 
  230.            files.
  231.          Typing no longer overwrites the horizontal scroll bar.
  232.          Fixed some minor annoyances in v. 0.8a, like new windows coming
  233.            up with the wrong horizonal scroll bar and the cursor not being
  234.            erased when a window is deselected.
  235. 0.9:     There were bad crashes after some combinations of “Returns to
  236.            Linefeeds” and Saves or Closes, due to an old bug in the Mac
  237.            Menu Manager. Fixed now.
  238.          Similar bug was causing the Edit Menu to disappear when “No 
  239.            Worksheet” was selected.
  240.          Worksheet and non-worksheet windows open with or without a 
  241.            Go-Away Box as they should.
  242.          Added partial support for extended keyboard (Undo, cut, paste,
  243.            copy, page up, page down).
  244.          In System 7, opening from the finder directs Standard File package
  245.            to proper directory.
  246.          Horizonal arrow keys work properly except anchor point not yet
  247.            implemented.
  248. 0.91:     Extended keyboard fully implemented.
  249.          Fixed crashes due to Menu Manager bug.
  250. 1.0:     Added entab and detab functions.
  251.          Added word wrap to line lengths
  252.          Added autoindent
  253.          These last required additions to Format dialog.
  254.          Horizontal arrow keys now have an anchor point.
  255.          Word wrap to window is default for foreign text files as well
  256.            as new ones.
  257.          Command-arrow key functions now update the scroll bars.
  258.          Fixed conditions that would could cause a window to forget 
  259.            that it was dirty, with subsequent loss of most-recently 
  260.            typed data.
  261.          Text inserted at end of a line now drawn properly.
  262.          Errors in calculating buffer length in this last condition
  263.            also fixed.
  264.          Blinking cursor no longer interferes with text.
  265.          Show Invisibles with proportional fonts now works properly.
  266.          Go-Away box appears when it should in all conditions. 
  267.          Fixed System 6 bugs--can now open from finder.
  268.          Hiliting of selection range is now always in the right place.
  269.          Inserting text beginning with a carriage return used to foul up
  270.            the line starts array. This could cause a crash.
  271.          Crashes related to marks and selections beyond the text buffer
  272.            fixed.
  273. 1.1:     Fixed crashes due to errors in writing resources.
  274.          This means that resource forks are no longer corrupted.
  275.          Word wrap to length now works for newly opened documents.
  276.          Marks stopped working in v.1.0. Fixed.
  277.          Text now updated after Tile or Stack Windows.
  278.           Scroll bars now properly hilited after Tile and Stack Windows.
  279. 1.2:     Format and date in ls -l command now correct.
  280.          Searches for Entire Word now work.
  281.          All Clipboard window deficiencies fixed, i.e. it is now updated
  282.            as it should be after cuts and copies, Menus are properly
  283.            updated when this is the selected window, and the blinking
  284.            cursor is disabled.
  285.          In large files, the blinking cursor would be displayed as a long
  286.            vertical line when the window was scrolled more than 32K pixels
  287.            beyond the insertion point. Fixed.
  288.          Line length default really set to 75. This means that the “Word 
  289.            Wrap to Length” menu item works from the very beginning.
  290.          Implemented “Revert to Saved.”
  291.          Fixed scrolling error when large blocks of text deleted.
  292. 1.2a:     When word wrap is on, Autoindent indents paragraphs, not lines.
  293.          PlainText will now open documents on locked volumes.
  294.          Saving now always flushes files to disk with every Save, even if 
  295.            it is a sleeping PowerBook disk.
  296.          Tile and Stack Windows now work properly when there is no 
  297.            worksheet.
  298.          No longer asks to save a saved new document when quitting.
  299.          Short lines nolonger pirate* the up and down arrow key cursor
  300.            movements.
  301.          Shift and align improved to work on word-wrapped paragraphs.
  302. 1.2b:     Marks now aligned after pasting text.
  303.          Will now print beyond 32K of text.
  304. 1.2c:     Marks now updated after large selections of text deleted.
  305.          Will now print invisible characters and tabs.
  306. 1.2d:     Added page numbers to printed page.
  307. 1.2.1:     First non-beta release to public servers, i.e. Info-Mac.
  308.           Restored “File open in another application” alert.
  309.           In word wrap, adding or deleting text that caused rewrapping of
  310.             paragraphs with more than 32 lines used to blank part of the 
  311.             window above the changed text. Fixed.
  312. 1.2.2     “Tile Windows” formally tiled the Worksheet window and not the 
  313.            last text window. It now excludes the Worksheet from tiling.
  314.          Added support for a Preferences file for storing defaults.
  315.          Added the stats command-line option.
  316.          Added a four-pixel tick mark at the top of each window to indicate
  317.            the printed page width, minus 1" right and left margins.
  318.          Tabs now aligned when typing in the middle of a line.
  319. 1.2.3     1.2.2 introduced a bug that caused characters typed at the beginning
  320.            of an empty window to either not be draw are drawn in the wrong
  321.            position.
  322. 1.2.4     There was still misalignment when tabs were typed. Fixed.
  323.          Added chtyp and chcre commands.
  324.          The “Find Selection” menu item now activated for locked windows.
  325.          Added the “Strip Controls” menu item.
  326. 1.2.5     Fixed curor misplacement when typing returns at the end of a text 
  327.            file with AutoIndent on.
  328.          Files without resource forks would not open. I think this bug also
  329.            caused drag-and-drop to fail for these files.
  330.          Fixed the sometimes garbled text in the confirmation dialogs.
  331.          Cut and paste now works in the Find and Replace dialogs.
  332.          “Revert to Saved” previously caused a scrolling error.
  333. 1.2.6     Deleting an entire file would not delete the file’s marks. Fixed.
  334.          Cursor initialized with each activate event.
  335. 1.2.7     “Save As…” and “Save A Copy…” will now replace an existing file in
  336.            the proper way.
  337.          Added “P” as the keyboard equivalent for printing.
  338. 1.2.8     Zooming is now to the best size for a text window and not full screen.
  339.          All other Apple guidelines for zooming now conformed to.
  340.          Scroll bars no longer drawn twice in zooming.
  341.          Stats command now works at all times.
  342.          New window opened to ideal size.
  343. 1.2.9     Fixed zooming bug introduced in 1.2.8 that caused crashes in System 6.
  344.          Several obscure coding errors turned up in using the MetroWorks. These
  345.           were probably never seen by users.
  346. 1.2.9     Further fix of zooming bug. (Thanks to Bruce Craven and Joel Martin.)
  347.            
  348. Known bugs
  349.      Marks are not properly updated after entab and detab functions.
  350.      Marks sometimes not updated properly during normal editing. (Probably 
  351.        fixed in v.1.2b.)
  352.      Unbroken text (i.e. containing no spaces) is wrapped to window width.
  353.      If no printer is selected, new windows do not appear on the screen.
  354.  
  355. Features to be added:
  356.      Modeless Search Dialog (thanks to David Wright).
  357.      Searching for carriage returns and other special characters.
  358.      Compile in PowerPC native mode.
  359.      Floating window for display of text stats.
  360.  
  361. Thanks to  Bruce Craven, Doug Dyment, Scott Gruby, Ralph Muha, Florin Neumann,
  362. Robert J. Rockefeller, Michael O’Henly, Russel N. Owen, Ted Ripberger, Rich 
  363. Siegel, David Wright, and particularly to Rich Scarlet for their many helpful
  364. comments.
  365.  
  366. ------------
  367.  
  368. * Geo-speak. A stream is pirated when its flow is diverted into a 
  369.   neighboring water course.
  370.